﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.CollectionsUI {
    import flash.display.*;
    import org.aswing.*;
    import Classes.*;
    import org.aswing.geom.*;
    import Display.MarketUI.*;
    import Display.InventoryUI.*;
    import Display.aswingui.*;
    import Display.MarketUI.assets.*;

    public class CollectionCatalogUI extends InventoryCatalogUI {

        public static const COLLECTIONS_TITLE_WIDTH:int = 565;
        public static const CENTER_GAP:int = 100;

        public function CollectionCatalogUI(){
            m_catalogTitle = ZLoc.t("Dialogs", "Collections");
        }
        override protected function get titleWidth():int{
            return (COLLECTIONS_TITLE_WIDTH);
        }
        override protected function get wishListTab():int{
            return (82);
        }
        override protected function get closeButtonGapFromTop():int{
            return (6);
        }
        override protected function get wishListGap():int{
            return (10);
        }
        override protected function get showInventory():Boolean{
            return (false);
        }
        override protected function makeBackground():void{
            var _local1:DisplayObject = (new EmbeddedArt.collections_bg() as DisplayObject);
            var _local2:MarginBackground = new MarginBackground(_local1, new Insets(TOP_INSET_HEIGHT));
            this.setBackgroundDecorator(_local2);
            this.setPreferredSize(new IntDimension(_local1.width, (_local1.height + TOP_INSET_HEIGHT)));
        }
        override public function goToItem(_arg1:String):void{
            var _local2:Array = m_shelf.data;
            var _local3:int = CardUtil.indexOfByCardName(_local2, _arg1);
            if (_local3 != -1){
                m_shelf.scrollToItemIndex(_local3);
            };
        }
        override public function switchType(_arg1:String):void{
            var _local3:XML;
            if (this.m_shelf != null){
                this.remove(m_shelfAP);
            };
            var _local2:XMLList = Global.gameSettings.getCollections();
            this.m_items = new Array();
            for each (_local3 in _local2) {
                this.m_items.push(new Collection(_local3));
            };
            m_shelf = new CollectionScrollingList(this.m_items, CollectionCellFactory, 0, 1, 2);
            ASwingHelper.prepare(m_shelf);
            m_centerPanel.append(m_shelf);
            m_centerPanel.setPreferredHeight(((Catalog.CARD_HEIGHT * 2) + CENTER_GAP));
            ASwingHelper.prepare(m_centerPanel);
        }

    }
}//package Display.CollectionsUI 
